#include "ChocolateBoiler.h"

#include <iostream>

ChocolateBoiler::ChocolateBoiler(){
    empty = true;
    boiled = false;
}

void ChocolateBoiler::fill(){
    if (empty) {
        std::cout << "Fill" << std::endl;
        empty = false;
        boiled = false;
    }
}

void ChocolateBoiler::drain(){
    if (!empty && boiled) {
        std::cout << "Drain" << std::endl;
        empty = true;
    }
}

void ChocolateBoiler::boil(){
    if (!empty && !boiled) {
        std::cout << "Boil" << std::endl;
        boiled = true;
    }
}

bool ChocolateBoiler::isEmpty(){
    return empty;
}

bool ChocolateBoiler::isBoiled(){
    return boiled;
}

ChocolateBoiler * ChocolateBoiler::getInstance(){
    if (uniqueInstance == NULL) {
        uniqueInstance = new ChocolateBoiler();
    }

    return uniqueInstance;
}

ChocolateBoiler *ChocolateBoiler::uniqueInstance = NULL;